package com.bnz.proxy;

import com.bnz.dao.UserDao;
import com.bnz.pojo.User;

public class UserDaoProxyImpl {
    //1. 引入目标对象
    private UserDao userDao;
    public UserDaoProxyImpl(UserDao userDao){
        this.userDao = userDao;
    }
    @Override
    public void add() {
        userDao.add();
    }

    @Override
    public void update() {
        userDao.update();
    }

    @Override
    public void delete() {
        userDao.delete();
    }

    @Override
    public void query() {
        checkSecurity();
        userDao.query();
    }

    @Override
    public void updateUser(int uid, double money) {

    }

    @Override
    public void addUser(User user) {

    }

    @Override
    public User findById(int id) {
        return null;
    }

    @Override
    public void update(User user) {

    }

    @Override
    public void delete(int id) {

    }

    private void checkSecurity(){
        System.out.println("进行安全性检查...");
    }
}
